/*******************************************************************************************
Copyright (C) 2008 Mestrelab Research S.L. All rights reserved.

This file is part of the MNova scripting toolkit.

Authorized users of MNova Software may use this file freely, but this file is provided AS IS
with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE.
*******************************************************************************************/ 
function absDirPathText()
{
	fn = Dir.temp() + "/MNova_File_Test.txt";
	print(fn);
	print(File.absDirPath(fn));

	var f = new File(fn);
	f.open(File.WriteOnly);
	f.close();
	print(f);
	print(f.absDirPath);
	f.remove();	
}

function fileTest()
{
	fn = Dir.temp() + "/MNova_File_Test.txt";
	var f = new File(fn);
	print(f);

	f1 = f;
	print(f1);
	
	var f2  = new File(f);
	print(f2);

	f.open(File.WriteOnly); // The way to create a file
	print(f);
	print(f1);
	print(f2);

	f.close();
	print(f);

	f.remove();
	print(f);

	File.create(fn);
	File.rename(fn, fn + ".1");
	File.remove(fn);
	f = new File(fn + ".1");
	print(f);
	File.remove(fn + ".1");
	print(f);

	Dir.setCurrent(Dir.temp());
	f.name = "MNova_File_Test_2.txt";
	print(f);
	f.open(File.WriteOnly);
	print(f);
	f.close();
	f.remove();
	print(f);
}
